<?php
defined ( 'BASEPATH' ) or exit ( 'No direct script access allowed' );
/**
 * 权限验证类
 *
 * @author LeeNux
 * @version 1.0
 *         
 */
class Permission {
	public $CI;
	public function __construct() {}
	/**
	 * 登录检测
	 *
	 * @param string $uid        	
	 * @return boolean
	 */
	public function isLogin($uid, $url = '') {
		$this->CI = &get_instance ();
		$v = $this->CI->session->$uid;
		if (empty ( $v ) && empty ( $url )) {
			return FALSE;
		} elseif (empty ( $v )) {
			redirect ( $url );
		} else
			return TRUE;
	}
}